package org.mozhu.rpc.transport.payload;

public abstract class PayloadHolder {
    private byte serializerCode;

    private byte[] bytes;

    public byte serializerCode() {
        return serializerCode;
    }

    public byte[] bytes() {
        return bytes;
    }

    public void bytes(byte serializerCode, byte[] bytes) {
        this.serializerCode = serializerCode;
        this.bytes = bytes;
    }

    // help gc
    public void clear() {
        bytes = null;
    }

    public int size() {
        return bytes == null ? 0 : bytes.length;
    }

}
